package erfgame.core.world.terrain.color;


import erfgame.core.util.ColorUtils;
import erfgame.core.world.terrain.TerrainColorSource;

public abstract class AbstractTerrainColorSource implements TerrainColorSource {

	private int minColor;
	private int maxColor;
	
	public AbstractTerrainColorSource( int minColor, int maxColor ) {
		this.minColor = minColor;
		this.maxColor = maxColor;
	}
	
	public int getColor(int x, int y, int z, int mult, int div, int dCeiling) {
		int baseColor = getBaseColor( x, y, z, dCeiling );
		return ColorUtils.multiplyColor( baseColor, this.minColor, this.maxColor, mult, div );
	}

	protected abstract int getBaseColor( int x, int y, int z, int dCeiling );
}
